//
//  UIView+Extension.m
//  封装轮播图
//
//  Created by 段瑞金 on 16/9/28.
//  Copyright © 2016年 大鼎智联. All rights reserved.
//

#import "UIView+Extension.h"

@implementation UIView (Extension)

//重写属性的set和get方法
-(CGFloat)drj_x
{
    return self.frame.origin.x;
}
-(CGFloat)drj_y
{
    return self.frame.origin.y;
}

-(void)setDrj_x:(CGFloat)drj_x
{
    CGRect frame = self.frame;
    frame.origin.x = drj_x;
    
    self.frame = frame;
}

-(void)setDrj_y:(CGFloat)drj_y
{
    CGRect frame = self.frame;
    frame.origin.y = drj_y;
    
    self.frame = frame;
}
-(CGFloat)drj_centerX
{
    return self.center.x;
}
-(CGFloat)drj_centerY
{
    return self.center.y;
}
-(void)setDrj_centerX:(CGFloat)drj_centerX
{
    CGPoint center = self.center;
    center.x = drj_centerX;
    
    self.center = center;
}
-(void)setDrj_centerY:(CGFloat)drj_centerY
{
    CGPoint center = self.center;
    center.y = drj_centerY;
    self.center = center;
}
-(CGFloat)drj_height
{
    return self.frame.size.height;
}

-(CGFloat)drj_width
{
    return self.frame.size.width;
}
-(void)setDrj_height:(CGFloat)drj_height
{
    CGRect frame = self.frame;
    frame.size.height = drj_height;
    
    self.frame = frame;
}

-(void)setDrj_width:(CGFloat)drj_width
{
    CGRect frame = self.frame;
    frame.size.width = drj_width;
    self.frame = frame;
}

-(CGSize)drj_size
{
    return self.frame.size;
}
-(void)setDrj_size:(CGSize)drj_size
{
    CGRect frame=self.frame;
    frame.size.width=drj_size.width;
    frame.size.height=drj_size.height;
    self.frame=frame;
}

@end
